package top.ezzz._test;

import cn.hutool.json.JSONUtil;
import top.ezzz.util.processtype.Holder;
import top.ezzz.util.processtype.ProcessContext;
import top.ezzz.util.processtype.TypeInterface;

public class ProcessTest {
    public static void main(String[] args) {
        Holder holder = new Holder();
        TypeInterface javaStrategy = holder.getProcessType(Holder.JAVA_PROCESS);
        ProcessContext context = new ProcessContext(javaStrategy);
        System.out.println("监控结果: " + JSONUtil.toJsonPrettyStr(context.monitor()));

        // 如需切换其他策略
        // TypeInterface pythonStrategy = holder.getProcessType("python");
        // context.setStrategy(pythonStrategy);
        // System.out.println("监控结果: " + context.monitor());
    }
}
